package com.dxyxx.android.setting;

import android.content.Context;
import android.content.SharedPreferences;

/**
 *  记录是否第一次 启动app
 * 
 * @author chinesejie
 * 
 */
public class GetstartPreferences {

	private static GetstartPreferences up = null;
	private static SharedPreferences.Editor editor = null;
	private static SharedPreferences sp = null;

	private GetstartPreferences() {
	}

	public static GetstartPreferences getInstance(Context context) {
		if (up == null) {
			up = new GetstartPreferences();
			sp = context.getSharedPreferences("getstart", Context.MODE_PRIVATE); // ---private
			editor = sp.edit();
		}
		return up;
	}

	public void setFlag() {
		editor.putBoolean("flag", true);
		editor.commit();
	}

	public boolean getFlag() {
		return sp.getBoolean("flag", false);
	}

}
